package com.rysima.wujiansima.demo;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class Demo1 {
    public static void main(String[] args) throws IOException {
//        1.键盘录入用户名和密码
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名");
        String username = sc.next();
        System.out.println("请输入密码");
        String password = sc.next();
//        2.写入数据
        FileWriter fw = new FileWriter("day10\\a.txt");
        fw.write(username);
        fw.write("\r\n");
        fw.write(password);
        fw.flush();
        fw.close();

    }
}
